<template>
	<view class="body">
		<u-navbar title="资讯详情" title-color="#000" :background="{ background: 'transparent' }" :autoBack="true"></u-navbar>

		<view class="name">{{ msgClass.title }}</view>
		<view class="t-data">
			<text>{{ msgClass.updateBy }}</text>
			{{ msgClass.createTime }}
		</view>
		<view class="img">
			<image :src="path + msgClass.imgUrl.split(',')[0]" mode=""></image>
		</view>

		<view class="text">
			<rich-text :nodes="msgClass.content" />
		</view>
	</view>
</template>


<script>
import msgList from '@/api/msgList';
import api from '@/api/index.js';
export default {
	data() {
		return {
			path: api.getPath(),
			msgClass: {}
		};
	},
	onLoad(o) {
		if (o.id) {
			this.getAxnews(o.id);
		}
	},
	methods: {
		getAxnews(id) {
			msgList.getAxnews(id).then((res) => {
				this.msgClass = res.data;
			});
		}
	}
};
</script>

<style lang="scss" scoped>
.body {
	min-height: 100vh;
	background: linear-gradient(167deg, #ffdad2 0%, #fff 20%);
	padding: 30rpx;
	.name {
		font-weight: bold;
		font-size: 29rpx;
		margin-left: 30rpx;
	}
	.t-data {
		color: #666;
		font-size: 24rpx;
		margin: 30rpx;
	}
	.img {
		image {
			width: 100%;
			height: 350rpx;
			border-radius: 50rpx;
		}
	}
	.text {
		padding: 30rpx 20rpx;
	}
}
</style>
